﻿@model WorkListVM
@{
    ViewBag.Title = Model.PageMeta != null ? Model.PageMeta.Title : "合作案例";
}

@section header{
    @if (Model.PageMeta != null)
    {
        <meta name="keywords" content="@Model.PageMeta.Keyword" />
        <meta name="description" content="@Model.PageMeta.Description" />
    }
   
}

<div class="banner" style="background:url(/Content/Desktop/img/banner/7.jpg)  no-repeat center center;">
</div>


<div class="container page-works">

    <h2 class="title_2">经典案例</h2>
        <nav class="topnav m-b-50">
            <ul>
               
                <li><a href="@Url.Action("Index", new { seoName = string.Empty })" class="btn @(string.IsNullOrEmpty(Model.SeoName)?"btn-red":" btn-default")">所有方案</a></li>

                @foreach (var item in Model.Categories)
                {
                    if (Model.SeoName == item.SeoName)
                    {
                        <li><a href="@Url.Action("Index",new { seoName = item.SeoName})" class="btn btn-red active">@item.Title</a></li>
                    }
                    else
                    {
                        <li><a href="@Url.Action("Index",new { seoName = item.SeoName})" class="btn btn-default">@item.Title</a></li>
                    }
                }
            </ul>
        </nav>
 
</div>

<section class="container page-case  m-b-50">
    @if (Model.Works.Any())
    {
                    <!-- Swiper -->
       
            <div class="row">
                @foreach (var link in Model.Works)
                {
                    <div class="col-xs-4">
                        <div class="item">
                            <a href="@Url.Action("Detail",new { id=link.Id})">
                                <figure>
                                    <img src="@link.Thumbnail" alt="@link.Title">
                                </figure>
                                <p>
                                    @link.Title
                                </p>
                            </a>
                        </div>
                    </div>

                }

            </div>
        

    }
    else
    {
        <div class="alert alert-info">
            <i class="iconfont icon-info"></i> 没有任何记录！
        </div>
    }

    <div class="text-center">
       
            @Html.PagedListPager((IPagedList)Model.Works, page => Url.Action("Index", new { page, seoName = Model.SeoName }))
       
        @*<div class="col-sm-5">
            <div class="text-right form-inline hidden">
                总计 @Model.TotalCount 条
            </div>
        </div>*@
    </div>

</section>




@section footer{
    <script src="~/plugins/Swiper/dist/js/swiper.jquery.min.js"></script>
    <script>

        //var initialization = function () {
        //    var query = Modernizr.mq('(orientation:landscape)');
        //    var winHeight = $(window).height(), headerHeight = $(".page-header").height(), footerHeight = $(".page-footer").height();
        //    var midHeight = query ? (winHeight - headerHeight - footerHeight - 46) / 2 : (winHeight - headerHeight - footerHeight - 70) / 3;
        //    //var imgHeight = $(".page-case .item img").height();
        //    //if(midHeight>imgHeight){
        //    //    $(".page-case .item figure").height(imgHeight);

        //    //    var paddingTop = midHeight-imgHeight;
        //    //    $(".page-case").css({"padding-top": paddingTop + "px"});
        //    //}else{
        //    $(".page-case .item figure").height(midHeight);
        //    //}
        //}

        $(function () {


            //if (Modernizr.mq('(orientation:landscape)')) {
            //    $(".swiper-container").swiper({
            //        //  pagination: '.swiper-pagination',
            //        slidesPerView: 4,
            //        slidesPerColumn: 2,
            //        paginationClickable: true,
            //        spaceBetween: 6,
            //        mousewheelControl: true

            //    });
            //} else {
            //    $(".swiper-container").swiper({
            //        //  pagination: '.swiper-pagination',
            //        slidesPerView: 2,
            //        slidesPerColumn: 3,
            //        paginationClickable: true,
            //        spaceBetween: 6,
            //        mousewheelControl: true

            //    });
            //}


            //initialization();
            //$(window).resize(function () {
            //    if (Modernizr.mq('(orientation:landscape)')) {
            //        $(".swiper-container").swiper({
            //            //  pagination: '.swiper-pagination',
            //            slidesPerView: 4,
            //            slidesPerColumn: 2,
            //            paginationClickable: true,
            //            spaceBetween: 6,
            //            mousewheelControl: true

            //        });
            //    } else {
            //        $(".swiper-container").swiper({
            //            //  pagination: '.swiper-pagination',
            //            slidesPerView: 2,
            //            slidesPerColumn: 3,
            //            paginationClickable: true,
            //            spaceBetween: 6,
            //            mousewheelControl: true

            //        });
            //    }
            //    initialization();
            //})




            $(".menu-toggle").on('click', function () {
                $(this).toggleClass("on");
                if ($('.topnav').hasClass("on")) {
                    $('.topnav').fadeOut(function () {
                        $('.topnav').removeClass("on");
                    })
                } else {
                    $('.topnav').addClass("on");
                    $('.topnav').fadeIn();
                }

            });

        });
    </script>
}